/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.psdk.remote;

import com.qihoo.psdk.util.a;
import com.qihoo.psdk.util.h;

public class j {
    protected static String a(int paramInt) {
        String str = "";
        if (paramInt == 0)
            str = paramInt + " " + "ping           -->" + " " + a.f();
        else if (1 == paramInt)
            str = paramInt + " " + "pong           <--" + " " + a.f();
        else if (2 == paramInt)
            str = paramInt + " " + "register       -->" + " " + a.f();
        else if (3 == paramInt)
            str = paramInt + " " + "message arrive <--" + " " + a.f();
        else if (4 == paramInt)
            str = paramInt + " " + "message ack    -->" + " " + a.f();
        else if (5 == paramInt)
            str = paramInt + " " + "unregister     -->" + " " + a.f();
        else if (6 == paramInt)
            str = paramInt + " " + "register ret   <--" + " " + a.f();
        else if (7 == paramInt)
            str = paramInt + " " + "unregister ret <--" + " " + a.f();
        return str;
    }

    public static byte[] a(String paramString1, String paramString2, String paramString3) {
        String str = "u:" + paramString1 + "@" + paramString2 + "\nt=300";
        short s = 2;
        h.a("QMsgConvert", "op: " + a(s) + ", pl: " + str);
        return a(str, s);
    }

    public static byte[] a() {
        String str = "";
        short s = 0;
        h.a("QMsgConvert", "op: " + a(s) + ", pl: " + str);
        return a(str, s);
    }

    public static byte[] a(String paramString1, String paramString2) {
        String str = "u:" + paramString1 + "@" + paramString2;
        short s = 5;
        h.a("QMsgConvert", "op: " + s + ", pl: " + str);
        return a(str, s);
    }

    public static byte[] a(String paramString) {
        String str = paramString;
        short s = 4;
        h.a("QMsgConvert", "op: " + a(s) + ", pl: " + str);
        return a(str, s);
    }

    private static byte[] a(String paramString, short paramShort) {
        short s = (short) paramString.length();
        byte[] arrayOfByte1 = d.a(5);
        byte[] arrayOfByte2 = d.a(paramShort);
        byte[] arrayOfByte3 = null;
        int i = 4 + s;
        if (s > 0) {
            arrayOfByte3 = d.a(s);
            i += 2;
        }
        int j = 0;
        byte[] arrayOfByte4 = new byte[i];
        for (int k = 0; k < arrayOfByte1.length; ++k)
            arrayOfByte4[(j++)] = arrayOfByte1[k];
        for (k = 0; k < arrayOfByte2.length; ++k)
            arrayOfByte4[(j++)] = arrayOfByte2[k];
        if (s > 0) {
            for (k = 0; k < arrayOfByte3.length; ++k)
                arrayOfByte4[(j++)] = arrayOfByte3[k];
            byte[] arrayOfByte5 = paramString.getBytes();
            for (int l = 0; l < arrayOfByte5.length; ++l)
                arrayOfByte4[(j++)] = arrayOfByte5[l];
        }
        return arrayOfByte4;
    }
}